//
//  CrosheMeauView.h
//  jhf
//
//  Created by 计海峰 on 2017/11/23 14:05:37.
//  Copyright © 2017年 计海峰. All rights reserved.
//

#import <UIKit/UIKit.h>

/* CGNumber. */

struct CGNumber {
    NSInteger xNum;
    NSInteger yNum;
};

typedef struct CGNumber CGNumber;

CG_INLINE CGNumber
CGNumberMake(NSInteger x, NSInteger y)
{
    CGNumber p; p.xNum = x; p.yNum = y; return p;
}

typedef void(^PressItem)(NSObject *obj , NSInteger idx);

#pragma mark -Model 显示的数据模型
@interface CrosheMeauModel : NSObject

@property (nonatomic,copy) NSString *imageUrl;

@property (nonatomic,copy) NSString *title;

@property (nonatomic,copy) NSString *imageName;

@property (nonatomic,assign) NSInteger type;

@property (nonatomic,strong)id extra;
//本地图片初始化
+ (CrosheMeauModel *)initWithLocalImageTitle:(NSString *)title andImageName:(NSString *)imageName andExtraInfo:(id)extra;

//本地网络图片
+ (CrosheMeauModel *)initWithImageUrlTitle:(NSString *)title andImageUrl:(NSString *)imageUrl andExtraInfo:(id)extra;;

//初始化
+ (CrosheMeauModel *)initWithTitle:(NSString *)title andImageName:(NSString *)imageName andImageUrl:(NSString *)imageUrl andExtraInfo:(id)extra;;

@end


#pragma mark -CrosheMeauViewBtn  每一块Button的创建
@interface ImageTitleView : UIView

@property (nonatomic,assign) CGRect rect;

@property (nonatomic,strong) CrosheMeauModel *entity;

- (id)initWithFrame:(CGRect)frame andEntity:(CrosheMeauModel *)entity;
@end

#pragma mark -CrosheMeauViewCell  每一页的显示数据

@interface CrosheMeauCell : UIView

@property (nonatomic,assign) CGRect rect;

@property (nonatomic,strong) NSArray<CrosheMeauModel*> *cellDataArray;

@property (nonatomic,assign) CGNumber numbers;

@property (nonatomic,strong) ImageTitleView *cellView;

- (instancetype)initWithCGSize:(CGRect)rect andNSNuber:(CGNumber)number andCellDataSource:(NSArray<CrosheMeauModel*> *)cellDataArray  andBlock:(PressItem)block;

@property (nonatomic,copy) PressItem pressItem;

@end

#pragma mark -CrosheMeauView  分类选择的View


@interface CrosheMeauView : UIView <UIScrollViewDelegate>

@property (nonatomic,strong) NSArray<CrosheMeauModel*> *dataArray;

@property (nonatomic,copy) PressItem pressItem;

@property (nonatomic,assign) CGRect rect;

@property (nonatomic,assign) CGNumber numbers;

@property (nonatomic,strong) UIPageControl *pageControl;

@property (nonatomic,strong) UIScrollView *scrollView;

- (instancetype)initWithDataSource:(NSArray<CrosheMeauModel*> *)dataArray andFrame:(CGRect)frame andCGNumer:(CGNumber)number andBlock:(PressItem)block;

@end


